package com.common.utils;

import java.security.SecureRandom;
import java.util.Random;

/**
 * 工具类
 * * * */
public class CommonUtils {

    /**
     * 生成比较不会重复的long类型*
     * * */
    public static Long getRandomLong(){
        SecureRandom secureRandom = new SecureRandom();
        String sl = String.valueOf(secureRandom.nextLong());
        String ts = String.valueOf(System.currentTimeMillis());
        StringBuilder id = new StringBuilder();
        Random random = new Random();
        id.append(sl.substring(12));
        id.append(ts.substring(6));
        return Long.valueOf(id.toString());
    }


}
